package unit4;

import java.util.Random;
public class Ex4_17_RandomApp {
    public static void main(String[] args) {
        Random ran1 = new Random();
        Random ran2 = new Random(123);
        System.out.println("第一组随机数:");
        System.out.println("\t 整型:" + ran1.nextInt());
        System.out.println("\t 长整型:" + ran1.nextLong());
        System.out.println("\t 浮点型:" + ran1.nextFloat());
        System.out.println("\t 双精度型:" + ran1.nextDouble());
        System.out.print("第二组随机数:");
        System.out.println();
        for (int i = 0; i < 4; i++) {
            System.out.println("\t 第" + i + "个随机数:" + ran2.nextInt() + " ");
        }
    }
}
